home *** CD-ROM | disk | FTP | other *** search
/ Computer Select (Limited Edition) / Computer Select.iso / dobbs / v17n02 / dflt10.exe / DFLAT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-21  |  19.5 KB  |  467 lines

  1. /* ------------- dflat.h ----------- */
  2. #ifndef DFLAT_H
  3. #define DFLAT_H
  4.  
  5. #ifdef BUILD_FULL_DFLAT
  6. #define INCLUDE_MULTI_WINDOWS
  7. #define INCLUDE_LOGGING
  8. #define INCLUDE_SHELLDOS
  9. #define INCLUDE_WINDOWOPTIONS
  10. #define INCLUDE_PICTUREBOX
  11. #define INCLUDE_MINIMIZE
  12. #define INCLUDE_MAXIMIZE
  13. #define INCLUDE_RESTORE
  14. #define INCLUDE_EXTENDEDSELECTIONS
  15. #endif
  16.  
  17. #include <stdio.h>
  18. #include <string.h>
  19. #include <stdlib.h>
  20. #include <dos.h>
  21. #include <process.h>
  22. #include <conio.h>
  23. #include <bios.h>
  24. #include <ctype.h>
  25. #include <io.h>
  26. #include <sys\types.h>
  27. #include <sys\stat.h>
  28. #include <time.h>
  29.  
  30. #define VERSION "Version 10"
  31.  
  32. #define TRUE 1
  33. #define FALSE 0
  34.  
  35. #define MAXMESSAGES 50
  36. #define DELAYTICKS 1
  37. #define FIRSTDELAY 7
  38. #define DOUBLETICKS 5
  39.  
  40. #define MAXTEXTLEN 65000U /* maximum text buffer            */
  41. #define EDITLEN     1024  /* starting length for multiliner */
  42. #define ENTRYLEN     256  /* starting length for one-liner  */
  43. #define GROWLENGTH    64  /* buffers grow by this much      */
  44.  
  45. #include "system.h"
  46. #include "config.h"
  47. #include "rect.h"
  48. #include "menu.h"
  49. #include "keys.h"
  50. #include "commands.h"
  51. #include "dialbox.h"
  52.  
  53. /* ------ integer type for message parameters ----- */
  54. typedef long PARAM;
  55.  
  56. typedef struct window {
  57.     CLASS class;           /* window class                  */
  58.     char *title;           /* window title                  */
  59.     struct window *parent; /* parent window                 */
  60.     int (*wndproc)
  61.         (struct window *, enum messages, PARAM, PARAM);
  62.     /* ----------------- window colors -------------------- */
  63.     char WindowColors[4][2];
  64.     /* ---------------- window dimensions ----------------- */
  65.     RECT rc;               /* window coordinates
  66.                                             (0/0 to 79/24)  */
  67.     int ht, wd;            /* window height and width       */
  68.     RECT RestoredRC;       /* restored condition rect       */
  69.     /* -------------- linked list pointers ---------------- */
  70.     struct window *nextfocus;   /* next window on screen    */
  71.     struct window *prevfocus;   /* previous window on screen*/
  72.     struct window *nextbuilt;   /* next window built        */
  73.     struct window *prevbuilt;   /* previous window built    */
  74.  
  75.     int attrib;                 /* Window attributes        */
  76.     char *videosave;            /* video save buffer        */
  77.     int condition;              /* Restored, Maximized,
  78.                                    Minimized, Closing       */
  79.     int oldcondition;           /* previous condition       */
  80.     int restored_attrib;        /* attributes when restored */
  81.     void *extension;      /* menus, dialogs, documents, etc */
  82.     struct window *PrevMouse;
  83.     struct window *PrevKeyboard;
  84.     struct window *MenuBarWnd;/* menu bar                   */
  85.     struct window *StatusBar; /* status bar                 */
  86.     /* ----------------- text box fields ------------------ */
  87.     int wlines;     /* number of lines of text              */
  88.     int wtop;       /* text line that is on the top display */
  89.     unsigned char *text; /* window text                     */
  90.     unsigned int textlen;  /* text length                   */
  91.     int wleft;      /* left position in window viewport     */
  92.     int textwidth;  /* width of longest line in textbox     */
  93.     int BlkBegLine; /* beginning line of marked block       */
  94.     int BlkBegCol;  /* beginning column of marked block     */
  95.     int BlkEndLine; /* ending line of marked block          */
  96.     int BlkEndCol;  /* ending column of marked block        */
  97.     int HScrollBox; /* position of horizontal scroll box    */
  98.     int VScrollBox; /* position of vertical scroll box      */
  99.     unsigned int *TextPointers; /* -> list of line offsets    */
  100.     /* ----------------- list box fields ------------------ */
  101.     int selection;  /* current selection                    */
  102.     int AddMode;    /* adding extended selections mode      */
  103.     int AnchorPoint;/* anchor point for extended selections */
  104.     int SelectCount;/* count of selected items              */
  105.     /* ----------------- edit box fields ------------------ */
  106.     int CurrCol;    /* Current column                       */
  107.     int CurrLine;   /* Current line                         */
  108.     int WndRow;     /* Current window row                   */
  109.     int TextChanged; /* TRUE if text has changed            */
  110.     unsigned char *DeletedText; /* for undo                 */
  111.     unsigned DeletedLength; /* Length of deleted field      */
  112.     int InsertMode;    /* TRUE or FALSE for text insert     */
  113.     int WordWrapMode;  /* TRUE or FALSE for word wrap       */
  114.     unsigned int MaxTextLength; /* maximum text length      */
  115.     /* ---------------- dialog box fields ----------------- */
  116.     void *dFocus;          /* control that has the focus    */
  117.     int ReturnCode;        /* return code from a dialog box */
  118.     int Modal;               /* True if a modeless dialog box */
  119.     CTLWINDOW *ct;           /* control structure             */
  120.     /* -------------- popdownmenu fields ------------------ */
  121.     MENU *mnu;        /* points to menu structure             */
  122.     MBAR *holdmenu; /* previous active menu                 */
  123.     /* --------------- help box fields -------------------- */
  124.     void *firstword; /* -> first in list of key words       */
  125.     void *lastword;  /* -> last in list of key words        */
  126.     void *thisword;  /* -> current in list of key words     */
  127.     /* -------------- status bar fields ------------------- */
  128.     int TimePosted;  /* True if time has been posted        */
  129. #ifdef INCLUDE_PICTUREBOX
  130.     /* ------------- picture box fields ------------------- */
  131.     int VectorCount;  /* number of vectors in vector list   */
  132.     void *VectorList; /* list of picture box vectors        */
  133. #endif
  134. } * WINDOW;
  135.  
  136. #include "classdef.h"
  137. #include "video.h"
  138.  
  139. enum Condition     {
  140.     ISRESTORED, ISMINIMIZED, ISMAXIMIZED, ISCLOSING
  141. };
  142.  
  143. void LogMessages (WINDOW, MESSAGE, PARAM, PARAM);
  144. void MessageLog(WINDOW);
  145. /* ------- window methods ----------- */
  146. #define ICONHEIGHT 3
  147. #define ICONWIDTH  10
  148. #define WindowHeight(w)      ((w)->ht)
  149. #define WindowWidth(w)       ((w)->wd)
  150. #define BorderAdj(w)         (TestAttribute(w,HASBORDER)?1:0)
  151. #define BottomBorderAdj(w)   (TestAttribute(w,HASSTATUSBAR)?1:BorderAdj(w))
  152. #define TopBorderAdj(w)      ((TestAttribute(w,HASTITLEBAR) &&   \
  153.                               TestAttribute(w,HASMENUBAR)) ?  \
  154.                               2 : (TestAttribute(w,HASTITLEBAR | \
  155.                               HASMENUBAR | HASBORDER) ? 1 : 0))
  156. #define ClientWidth(w)       (WindowWidth(w)-BorderAdj(w)*2)
  157. #define ClientHeight(w)      (WindowHeight(w)-TopBorderAdj(w)-\
  158.                               BottomBorderAdj(w))
  159. #define WindowRect(w)        ((w)->rc)
  160. #define GetTop(w)            (RectTop(WindowRect(w)))
  161. #define GetBottom(w)         (RectBottom(WindowRect(w)))
  162. #define GetLeft(w)           (RectLeft(WindowRect(w)))
  163. #define GetRight(w)          (RectRight(WindowRect(w)))
  164. #define GetClientTop(w)      (GetTop(w)+TopBorderAdj(w))
  165. #define GetClientBottom(w)   (GetBottom(w)-BottomBorderAdj(w))
  166. #define GetClientLeft(w)     (GetLeft(w)+BorderAdj(w))
  167. #define GetClientRight(w)    (GetRight(w)-BorderAdj(w))
  168. #define GetParent(w)         ((w)->parent)
  169. #define GetTitle(w)          ((w)->title)
  170. #define NextWindow(w)        ((w)->nextfocus)
  171. #define PrevWindow(w)        ((w)->prevfocus)
  172. #define NextWindowBuilt(w)   ((w)->nextbuilt)
  173. #define PrevWindowBuilt(w)   ((w)->prevbuilt)
  174. #define GetClass(w)          ((w)->class)
  175. #define GetAttribute(w)      ((w)->attrib)
  176. #define AddAttribute(w,a)    (GetAttribute(w) |= a)
  177. #define ClearAttribute(w,a)  (GetAttribute(w) &= ~(a))
  178. #define TestAttribute(w,a)   (GetAttribute(w) & (a))
  179. #define isWndVisible(w)      (GetAttribute(w) & VISIBLE)
  180. #define SetVisible(w)        (GetAttribute(w) |= VISIBLE)
  181. #define ClearVisible(w)      (GetAttribute(w) &= ~VISIBLE)
  182. #define gotoxy(w,x,y) cursor(w->rc.lf+(x)+1,w->rc.tp+(y)+1)
  183. int isVisible(WINDOW);
  184. WINDOW CreateWindow(CLASS,char *,int,int,int,int,void*,WINDOW,
  185.        int (*)(struct window *,enum messages,PARAM,PARAM),int);
  186. void AddTitle(WINDOW, char *);
  187. void InsertTitle(WINDOW, char *);
  188. void DisplayTitle(WINDOW, RECT *);
  189. void RepaintBorder(WINDOW, RECT *);
  190. void ClearWindow(WINDOW, RECT *, int);
  191. void writeline(WINDOW, char *, int, int, int);
  192. void InitWindowColors(WINDOW);
  193.  
  194. void SetNextFocus(WINDOW);
  195. void SetPrevFocus(WINDOW);
  196. void SkipSystemWindows(int);
  197. void RemoveFocusWindow(WINDOW);
  198. void AppendFocusWindow(WINDOW);
  199. void PrependFocusWindow(WINDOW);
  200. void RemoveBuiltWindow(WINDOW);
  201. void AppendBuiltWindow(WINDOW);
  202. WINDOW GetFirstChild(WINDOW);
  203. WINDOW GetNextChild(WINDOW, WINDOW);
  204. WINDOW GetLastChild(WINDOW);
  205. WINDOW GetPrevChild(WINDOW, WINDOW);
  206. WINDOW GetFirstFocusChild(WINDOW);
  207. WINDOW GetNextFocusChild(WINDOW, WINDOW);
  208.  
  209. int CharInView(WINDOW, int, int);
  210. void GetVideoBuffer(WINDOW);
  211. void RestoreVideoBuffer(WINDOW);
  212. void CreatePath(char *, char *, int, int);
  213. int LineLength(char *);
  214. RECT AdjustRectangle(WINDOW, RECT);
  215. int isDerivedFrom(WINDOW, CLASS);
  216. WINDOW GetAncestor(WINDOW);
  217. void PutWindowChar(WINDOW,int,int,int);
  218. void PutWindowLine(WINDOW, void *,int,int);
  219. #define BaseWndProc(class,wnd,msg,p1,p2)    \
  220.     (*classdefs[(classdefs[class].base)].wndproc)(wnd,msg,p1,p2)
  221. #define DefaultWndProc(wnd,msg,p1,p2)         \
  222.     (classdefs[wnd->class].wndproc == NULL) ? \
  223.     BaseWndProc(wnd->class,wnd,msg,p1,p2) :      \
  224.     (*classdefs[wnd->class].wndproc)(wnd,msg,p1,p2)
  225. struct LinkedList    {
  226.     WINDOW FirstWindow;
  227.     WINDOW LastWindow;
  228. };
  229. extern struct LinkedList Focus;
  230. extern struct LinkedList Built;
  231. extern WINDOW inFocus;
  232. extern WINDOW CaptureMouse;
  233. extern WINDOW CaptureKeyboard;
  234. extern int foreground, background;
  235. extern int WindowMoving;
  236. extern int WindowSizing;
  237. extern int TextMarking;
  238. extern int VSliding;
  239. extern int HSliding;
  240. extern char *Clipboard;
  241. extern unsigned ClipboardLength;
  242. extern int VSliding;
  243. extern int HSliding;
  244. extern char DFlatApplication[];
  245. extern int ClipString;
  246. /* --------- space between menubar labels --------- */
  247. #define MSPACE 2
  248. /* --------------- border characters ------------- */
  249. #define FOCUS_NW      (unsigned char) '\xc9'
  250. #define FOCUS_NE      (unsigned char) '\xbb'
  251. #define FOCUS_SE      (unsigned char) '\xbc'
  252. #define FOCUS_SW      (unsigned char) '\xc8'
  253. #define FOCUS_SIDE    (unsigned char) '\xba'
  254. #define FOCUS_LINE    (unsigned char) '\xcd'
  255. #define NW            (unsigned char) '\xda'
  256. #define NE            (unsigned char) '\xbf'
  257. #define SE            (unsigned char) '\xd9'
  258. #define SW            (unsigned char) '\xc0'
  259. #define SIDE          (unsigned char) '\xb3'
  260. #define LINE          (unsigned char) '\xc4'
  261. #define LEDGE         (unsigned char) '\xc3'
  262. #define REDGE         (unsigned char) '\xb4'
  263. /* ------------- scroll bar characters ------------ */
  264. #define UPSCROLLBOX    (unsigned char) '\x1e'
  265. #define DOWNSCROLLBOX  (unsigned char) '\x1f'
  266. #define LEFTSCROLLBOX  (unsigned char) '\x11'
  267. #define RIGHTSCROLLBOX (unsigned char) '\x10'
  268. #define SCROLLBARCHAR  (unsigned char) 176 
  269. #define SCROLLBOXCHAR  (unsigned char) 178
  270. /* ------------------ menu characters --------------------- */
  271. #define CHECKMARK      (unsigned char) (SCREENHEIGHT==25?251:4)
  272. #define CASCADEPOINTER (unsigned char) '\x10'
  273. /* ----------------- title bar characters ----------------- */
  274. #define CONTROLBOXCHAR (unsigned char) '\xf0'
  275. #define MAXPOINTER     24      /* maximize token            */
  276. #define MINPOINTER     25      /* minimize token            */
  277. #define RESTOREPOINTER 18      /* restore token             */
  278. /* --------------- text control characters ---------------- */
  279. #define APPLCHAR     (unsigned char) 176 /* fills application window */
  280. #define SHORTCUTCHAR '~'    /* prefix: shortcut key display */
  281. #define CHANGECOLOR  (unsigned char) 174 /* prefix to change colors  */
  282. #define RESETCOLOR   (unsigned char) 175 /* reset colors to default  */
  283. #define LISTSELECTOR   4    /* selected list box entry      */
  284. /* --------- message prototypes ----------- */
  285. void init_messages(void);
  286. void PostMessage(WINDOW, MESSAGE, PARAM, PARAM);
  287. int SendMessage(WINDOW, MESSAGE, PARAM, PARAM);
  288. int dispatch_message(void);
  289. int TestCriticalError(void);
  290. /* ---- standard window message processing prototypes ----- */
  291. int ApplicationProc(WINDOW, MESSAGE, PARAM, PARAM);
  292. int NormalProc(WINDOW, MESSAGE, PARAM, PARAM);
  293. int TextBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  294. int ListBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  295. int EditBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  296. int PictureProc(WINDOW, MESSAGE, PARAM, PARAM);
  297. int MenuBarProc(WINDOW, MESSAGE, PARAM, PARAM);
  298. int PopDownProc(WINDOW, MESSAGE, PARAM, PARAM);
  299. int ButtonProc(WINDOW, MESSAGE, PARAM, PARAM);
  300. int ComboProc(WINDOW, MESSAGE, PARAM, PARAM);
  301. int TextProc(WINDOW, MESSAGE, PARAM, PARAM);
  302. int RadioButtonProc(WINDOW, MESSAGE, PARAM, PARAM);
  303. int CheckBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  304. int SpinButtonProc(WINDOW, MESSAGE, PARAM, PARAM);
  305. int BoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  306. int DialogProc(WINDOW, MESSAGE, PARAM, PARAM);
  307. int SystemMenuProc(WINDOW, MESSAGE, PARAM, PARAM);
  308. int HelpBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  309. int MessageBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  310. int CancelBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  311. int ErrorBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  312. int YesNoBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  313. int StatusBarProc(WINDOW, MESSAGE, PARAM, PARAM);
  314. /* ------------- normal box prototypes ------------- */
  315. int isWindow(WINDOW);
  316. WINDOW inWindow(int, int);
  317. void SetStandardColor(WINDOW);
  318. void SetReverseColor(WINDOW);
  319. #define HitControlBox(wnd, p1, p2)     \
  320.      (TestAttribute(wnd, CONTROLBOX) && \
  321.      p1 == 2 && p2 == 0)
  322. #define WndForeground(wnd)         \
  323.     (wnd->WindowColors [STD_COLOR] [FG])
  324. #define WndBackground(wnd)         \
  325.     (wnd->WindowColors [STD_COLOR] [BG])
  326. #define FrameForeground(wnd)     \
  327.     (wnd->WindowColors [FRAME_COLOR] [FG])
  328. #define FrameBackground(wnd)     \
  329.     (wnd->WindowColors [FRAME_COLOR] [BG])
  330. #define SelectForeground(wnd)     \
  331.     (wnd->WindowColors [SELECT_COLOR] [FG])
  332. #define SelectBackground(wnd)     \
  333.     (wnd->WindowColors [SELECT_COLOR] [BG])
  334. #define HighlightForeground(wnd)     \
  335.     (wnd->WindowColors [HILITE_COLOR] [FG])
  336. #define HighlightBackground(wnd)     \
  337.     (wnd->WindowColors [HILITE_COLOR] [BG])
  338. #define WindowClientColor(wnd, fg, bg)     \
  339.         WndForeground(wnd) = fg, WndBackground(wnd) = bg
  340. #define WindowReverseColor(wnd, fg, bg) \
  341.         SelectForeground(wnd) = fg, SelectBackground(wnd) = bg
  342. #define WindowFrameColor(wnd, fg, bg) \
  343.         FrameForeground(wnd) = fg, FrameBackground(wnd) = bg
  344. #define WindowHighlightColor(wnd, fg, bg) \
  345.         HighlightForeground(wnd) = fg, HighlightBackground(wnd) = bg
  346. /* -------- text box prototypes ---------- */
  347. #define TextLine(wnd, sel) \
  348.       (wnd->text + *((wnd->TextPointers) + sel))
  349. void WriteTextLine(WINDOW, RECT *, int, int);
  350. void SetAnchor(WINDOW, int, int);
  351. #define TextBlockMarked(wnd) (  wnd->BlkBegLine ||    \
  352.                                 wnd->BlkEndLine ||    \
  353.                                 wnd->BlkBegCol  ||    \
  354.                                 wnd->BlkEndCol)
  355. void MarkTextBlock(WINDOW, int, int, int, int);
  356. #define ClearTextBlock(wnd) wnd->BlkBegLine = wnd->BlkEndLine =  \
  357.                         wnd->BlkBegCol  = wnd->BlkEndCol = 0;
  358. #define GetText(w)        ((w)->text)
  359. #define GetTextLines(w)   ((w)->wlines)
  360. void ClearTextPointers(WINDOW);
  361. void BuildTextPointers(WINDOW);
  362. int TextLineNumber(WINDOW, char *);
  363. /* ------------ Clipboard prototypes ------------- */
  364. void CopyToClipboard(WINDOW);
  365. #define PasteFromClipboard(wnd) PasteText(wnd,Clipboard,ClipboardLength)
  366. int PasteText(WINDOW, char *, unsigned);
  367. /* --------- menu prototypes ---------- */
  368. int CopyCommand(unsigned char *, unsigned char *, int, int);
  369. void PrepFileMenu(void *, struct Menu *);
  370. void PrepEditMenu(void *, struct Menu *);
  371. void PrepSearchMenu(void *, struct Menu *);
  372. void PrepWindowMenu(void *, struct Menu *);
  373. void BuildSystemMenu(WINDOW);
  374. int isActive(MBAR *, int);
  375. char *GetCommandText(MBAR *, int);
  376. int isCascadedCommand(MBAR *,int);
  377. void ActivateCommand(MBAR *,int);
  378. void DeactivateCommand(MBAR *,int);
  379. int GetCommandToggle(MBAR *,int);
  380. void SetCommandToggle(MBAR *,int);
  381. void ClearCommandToggle(MBAR *,int);
  382. void InvertCommandToggle(MBAR *,int);
  383. int BarSelection(int);
  384. /* ------------- list box prototypes -------------- */
  385. int ItemSelected(WINDOW, int);
  386. /* ------------- edit box prototypes ----------- */
  387. #define CurrChar (TextLine(wnd, wnd->CurrLine)+wnd->CurrCol)
  388. #define WndCol   (wnd->CurrCol-wnd->wleft)
  389. #define isMultiLine(wnd)     TestAttribute(wnd, MULTILINE)
  390. void SearchText(WINDOW);
  391. void ReplaceText(WINDOW);
  392. void SearchNext(WINDOW);
  393. void ResetEditBox(WINDOW);
  394. /* --------- message box prototypes -------- */
  395. int GenericMessage(WINDOW, char *, char *, int,
  396.     int (*)(struct window *, enum messages, PARAM, PARAM),
  397.     char *, char *, int, int, int);
  398. #define TestErrorMessage(msg)    \
  399.     GenericMessage(NULL, "Error", msg, 2, ErrorBoxProc,      \
  400.         Ok, Cancel, ID_OK, ID_CANCEL, TRUE)
  401. #define ErrorMessage(msg) \
  402.     GenericMessage(NULL, "Error", msg, 1, ErrorBoxProc,   \
  403.         Ok, NULL, ID_OK, 0, TRUE)
  404. #define MessageBox(ttl, msg) \
  405.     GenericMessage(NULL, ttl, msg, 1, MessageBoxProc, \
  406.         Ok, NULL, ID_OK, 0, TRUE)
  407. #define YesNoBox(msg)    \
  408.     GenericMessage(NULL, NULL, msg, 2, YesNoBoxProc,   \
  409.         Yes, No, ID_OK, ID_CANCEL, TRUE)
  410. #define CancelBox(wnd, msg) \
  411.     GenericMessage(wnd, "Wait...", msg, 1, CancelBoxProc, \
  412.         Cancel, NULL, ID_CANCEL, 0, FALSE)
  413. void CloseCancelBox(void);
  414. WINDOW MomentaryMessage(char *);
  415. int MsgHeight(char *);
  416. int MsgWidth(char *);
  417.  
  418. /* ------------- dialog box prototypes -------------- */
  419. int DialogBox(WINDOW, DBOX *, int,
  420.        int (*)(struct window *, enum messages, PARAM, PARAM));
  421. int OpenFileDialogBox(char *, char *);
  422. int SaveAsDialogBox(char *);
  423. void GetDlgListText(WINDOW, char *, enum commands);
  424. int DlgDirList(WINDOW, char *, enum commands,
  425.                             enum commands, unsigned);
  426. int RadioButtonSetting(DBOX *, enum commands);
  427. void PushRadioButton(DBOX *, enum commands);
  428. void PutItemText(WINDOW, enum commands, char *);
  429. void PutComboListText(WINDOW, enum commands, char *);
  430. void GetItemText(WINDOW, enum commands, char *, int);
  431. char *GetDlgTextString(DBOX *, enum commands, CLASS);
  432. void SetDlgTextString(DBOX *, enum commands, char *, CLASS);
  433. void SetCheckBox(DBOX *, enum commands);
  434. void ClearCheckBox(DBOX *, enum commands);
  435. int CheckBoxSetting(DBOX *, enum commands);
  436. CTLWINDOW *FindCommand(DBOX *, enum commands, int);
  437. WINDOW ControlWindow(DBOX *, enum commands);
  438. void EnableButton(DBOX *, enum commands);
  439. void DisableButton(DBOX *, enum commands);
  440. #define GetControl(wnd) (wnd->ct)
  441.  
  442. #define GetDlgText(db, cmd) GetDlgTextString(db, cmd, TEXT)
  443. #define GetDlgTextBox(db, cmd) GetDlgTextString(db, cmd, TEXTBOX)
  444. #define GetEditBoxText(db, cmd) GetDlgTextString(db, cmd, EDITBOX)
  445. #define GetComboBoxText(db, cmd) GetDlgTextString(db, cmd, COMBOBOX)
  446. #define SetDlgText(db, cmd, s) SetDlgTextString(db, cmd, s, TEXT)
  447. #define SetDlgTextBox(db, cmd, s) SetDlgTextString(db, cmd, s, TEXTBOX)
  448. #define SetEditBoxText(db, cmd, s) SetDlgTextString(db, cmd, s, EDITBOX)
  449. #define SetComboBoxText(db, cmd, s) SetDlgTextString(db, cmd, s, COMBOBOX)
  450.  
  451. /* ---- types of vectors that can be in a picture box ------- */
  452. enum VectTypes {VECTOR, SOLIDBAR, HEAVYBAR, CROSSBAR, LIGHTBAR};
  453.  
  454. /* ------------- picture box prototypes ------------- */
  455. void DrawVector(WINDOW, int, int, int, int);
  456. void DrawBox(WINDOW, int, int, int, int);
  457. void DrawBar(WINDOW, enum VectTypes, int, int, int, int);
  458.  
  459. /* ------------- help box prototypes ------------- */
  460. void LoadHelpFile(void);
  461. void UnLoadHelpFile(void);
  462. int DisplayHelp(WINDOW, char *);
  463.  
  464. extern char *ClassNames[];
  465.  
  466. #endif
  467.